package cn.shyouchi.wuguanjia.android.api.attendance;

import java.util.List;
import java.util.Map;

import cn.shyouchi.wuguanjia.android.model.BaseRequestResult;
import cn.shyouchi.wuguanjia.android.model.BaseResult;
import cn.shyouchi.wuguanjia.android.ui.attendance.AttendanceEntity;
import cn.shyouchi.wuguanjia.android.ui.attendance.report.StaffPostEntity;
import cn.shyouchi.wuguanjia.android.ui.attendance.report.StaffReportEntity;
import cn.shyouchi.wuguanjia.android.ui.attendance.signin.AttendanceInfoEntity;
import cn.shyouchi.wuguanjia.android.ui.attendance.signout.SignbackRank;
import cn.shyouchi.wuguanjia.android.ui.attendance.statistics.StatisticsInfoEntity;
import cn.shyouchi.wuguanjia.android.ui.attendance.temporary.TemporaryTaskEntity;
import cn.shyouchi.wuguanjia.android.ui.reportstatistic.ReportDayStatisticEntity;
import cn.shyouchi.wuguanjia.android.ui.reportstatistic.ReportStatisticEntity;
import cn.shyouchi.wuguanjia.android.ui.statistic.NewlyInfo;
import cn.shyouchi.wuguanjia.android.ui.statistic.SignStatisticManagerEntity;
import cn.shyouchi.wuguanjia.android.ui.statistic.UserMonthRank;
import cn.shyouchi.wuguanjia.android.ui.statistic.page.MonthStatisticEntity;
import cn.shyouchi.wuguanjia.android.ui.statistic.page.YearStatisticEntity;
import cn.shyouchi.wuguanjia.android.ui.statistic.user.AbseUser;
import cn.shyouchi.wuguanjia.android.ui.statistic.user.EarlyUser;
import cn.shyouchi.wuguanjia.android.ui.statistic.user.LateUser;
import cn.shyouchi.wuguanjia.android.ui.statistic.user.OutUser;
import cn.shyouchi.wuguanjia.android.ui.statistic.user.PracticeUser;
import cn.shyouchi.wuguanjia.android.ui.statistic.user.SecondedUser;
import okhttp3.MultipartBody;
import okhttp3.RequestBody;
import retrofit2.http.GET;
import retrofit2.http.Multipart;
import retrofit2.http.POST;
import retrofit2.http.Part;
import retrofit2.http.PartMap;
import retrofit2.http.Path;
import retrofit2.http.Query;
import rx.Observable;

/**
 * Created by Eenie on 2016/12/14 at 10:38
 * Email: 472279981@qq.com
 * Des:
 */

public interface AttendanceService {

    /**
     * 获取班次列表
     *
     * @param date
     * @return
     */
    @GET("userSchedulingList")
    Observable<AttendanceEntity> getUserSchedulingList(@Query("date") String date);


    @GET("check/attendanceList")
    Observable<AttendanceInfoEntity> getCheckAttendance();


    @GET("lastPlace")
    Observable<BaseRequestResult> isLast(@Query("serviceid") String id);

    @GET("total/index")
    Observable<SignStatisticManagerEntity> getEvents();

    /**
     * 获取考勤统计日期
     *
     * @return
     */
    @GET("total/date")
    Observable<YearStatisticEntity> getStatisticDate();

    /**
     * 获取统计数据
     *
     * @param date
     * @return
     */
    @GET("total/indexlist")
    Observable<MonthStatisticEntity> getStatisticData(@Query("date") String date, @Query("projectid") String projectid);
    /**
     * 获取团队排名详细
     *
     * @param date
     * @return
     */

    /**
     * 获取年统计数据
     *
     * @param date
     * @return
     */
    @GET("year/indexlist")
    Observable<MonthStatisticEntity> getYearStatisticData(@Query("date") String date, @Query("projectid") String projectid);

    /**
     * 获取团队排名详细
     *
     * @param date
     * @return
     */


    @GET("{path}/rank")
    Observable<BaseRequestResult<List<UserMonthRank>>> getMothRankStatisticData(@Path("path") String path, @Query("date") String date, @Query("projectid") String projectid);

    /**
     * 获取团队综合排名详细
     *
     * @param date
     * @return
     */


    @GET("{path}/integrated")
    Observable<BaseRequestResult<List<UserMonthRank>>> getIntegratedStatisticData(@Path("path") String path, @Query("date") String date, @Query("projectid") String projectid);

    /**
     * 获取加油榜详细
     *
     * @param date
     * @return
     */
    @GET("{path}/refue")
    Observable<BaseRequestResult<List<UserMonthRank>>> getMothRefueStatisticData(@Path("path") String path, @Query("date") String date, @Query("projectid") String projectid);

    /**
     * 获取月增添加员工
     *
     * @param date
     * @return
     */
    @GET("{path}/newemployees")
    Observable<BaseRequestResult<List<NewlyInfo>>> getMothNewlyStaff(@Path("path") String path, @Query("date") String date, @Query("projectid") String projectid);

    /**
     * 获取月迟到用户列表
     *
     * @param date
     * @return
     */
    @GET("{path}/late")
    Observable<BaseRequestResult<List<LateUser>>> getMothLateUsers(@Path("path") String path, @Query("date") String date, @Query("projectid") String projectid);

    /**
     * 获取月早退用户列表
     *
     * @param date
     * @return
     */
    @GET("{path}/leave")
    Observable<BaseRequestResult<List<EarlyUser>>> getMothEarlyUsers(@Path("path") String path, @Query("date") String date, @Query("projectid") String projectid);

    /**
     * 获取月旷工用户列表
     *
     * @param date
     * @return
     */
    @GET("{path}/absenteeism")
    Observable<BaseRequestResult<List<AbseUser>>> getMothAbseUserUsers(@Path("path") String path, @Query("date") String date, @Query("projectid") String projectid);

    /**
     * 获取月外出用户列表
     *
     * @param date
     * @return
     */
    @GET("{path}/goout")
    Observable<BaseRequestResult<List<OutUser>>> getMothOutUserUsers(@Path("path") String path, @Query("date") String date, @Query("projectid") String projectid);

    /**
     * 获取月实习用户列表
     *
     * @param date
     * @return
     */
    @GET("{path}/practice")
    Observable<BaseRequestResult<List<PracticeUser>>> getMothPracticeUserUsers(@Path("path") String path, @Query("date") String date, @Query("projectid") String projectid);

    /**
     * 获取月借调用户列表
     *
     * @param date
     * @return
     */
    @GET("{path}/seconded")
    Observable<BaseRequestResult<List<SecondedUser>>> getMothSecondedUserUsers(@Path("path") String path, @Query("date") String date, @Query("projectid") String projectid);


    /**
     * 签到
     *
     * @param params
     * @param img
     * @return
     */
    @Multipart
    @POST("checkInAdd")
    Observable<BaseRequestResult> signIn(@PartMap Map<String, RequestBody> params, @Part MultipartBody.Part img);

    /**
     * 签退
     *
     * @param params
     * @param img
     * @return
     */
    @Multipart
    @POST("signbackAdd")
    Observable<BaseRequestResult> signOut(@PartMap Map<String, RequestBody> params, @Part MultipartBody.Part img);

    /**
     * 临保签到
     *
     * @param params
     * @param img
     * @return
     */
    @Multipart
    @POST("temporarySecurity/Verification")
    Observable<BaseRequestResult> temporarySignIn(
            @PartMap Map<String, RequestBody> params,
            @Part MultipartBody.Part img);

    /**
     * @return
     */
    @GET("temporaryInsuranceTask")
    Observable<TemporaryTaskEntity> getTemporaryTask();


    /**
     * 获取考勤详情
     *
     * @return
     */
    @GET("attendance/statistics")
    Observable<StatisticsInfoEntity> getStatistics();

    /**
     * 获取考勤详情
     *
     * @return
     */
    @GET("signOff")
    Observable<BaseResult<SignbackRank>> getSignbackRank();

    /**
     * 获取个人考勤详情
     *
     * @return
     */
    @GET("attendance/statistics")
    Observable<StatisticsInfoEntity> getStatisticsByUser(@Query("userid") String user, @Query("date") String date);


    /**
     * 获取岗位列表
     *
     * @return
     */
    @GET("signedtosign/postList")
    Observable<StaffPostEntity> getSignPostList();


    @GET("signedtosign/newspaperpostList")
    Observable<StaffReportEntity> getSignPostDetail(@Query("postsettingid") String postId);

    @GET("signedtosign/statisticsIndex")
    Observable<ReportStatisticEntity> getReportStatistic(@Query("projectid") String id);


    @GET("signedtosign/NotInfo")
    Observable<BaseRequestResult<List<ReportDayStatisticEntity>>> getReportStatisticInfo(@Query("date") String date, @Query("projectid") String projectId);


    /**
     * 添加报岗
     *
     * @param params
     * @param img
     * @return
     */
    @Multipart
    @POST("signedtosignAdd")
    Observable<BaseRequestResult> reportAdd(
            @PartMap Map<String, RequestBody> params,
            @Part MultipartBody.Part img);


}
